import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
	state: {
		globalVariable: 'http://localhost:8080/app'
	},
	mutations: {
		updateGlobalVariable(state, newVal) {
			state.globalVariable = newVal;
		}
	},
	actions: {
		updateGlobalVariableAction({
			commit
		}, newVal) {
			commit('updateGlobalVariable', newVal);
		}
	},
	getters: {
		getGlobalVariable: state => state.globalVariable
	}
});